package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Log entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_LOG", uniqueConstraints = @UniqueConstraint(columnNames = "LOG_ID"))
public class Log implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -1081558048622312324L;
	private String logId;
	private String operName;
	private String cardNo;
	private String logDate;
	private String logTime;
	private String logType;
	private String logDesc;

	// Constructors

	/** default constructor */
	public Log() {
	}

	/** minimal constructor */
	public Log(String logId, String logDate, String logTime,
			String logType, String logDesc) {
		this.logId = logId;
		this.logDate = logDate;
		this.logTime = logTime;
		this.logType = logType;
		this.logDesc = logDesc;
	}

	/** full constructor */
	public Log(String logId, String operName, String cardNo, String logDate,
			String logTime, String logType, String logDesc) {
		this.logId = logId;
		this.operName = operName;
		this.cardNo = cardNo;
		this.logDate = logDate;
		this.logTime = logTime;
		this.logType = logType;
		this.logDesc = logDesc;
	}

	// Property accessors

	@Id
	@Column(name = "LOG_ID", unique = true, nullable = false, length = 20)
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}

	@Column(name = "OPER_NAME", length = 40)
	public String getOperName() {
		return this.operName;
	}

	public void setOperName(String operName) {
		this.operName = operName;
	}

	@Column(name = "CARD_NO", length = 20)
	public String getCardNo() {
		return this.cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	@Column(name = "LOG_DATE", nullable = false, length = 8)
	public String getLogDate() {
		return this.logDate;
	}

	public void setLogDate(String logDate) {
		this.logDate = logDate;
	}

	@Column(name = "LOG_TIME", nullable = false, length = 6)
	public String getLogTime() {
		return this.logTime;
	}

	public void setLogTime(String logTime) {
		this.logTime = logTime;
	}

	@Column(name = "LOG_TYPE", nullable = false, length = 1)
	public String getLogType() {
		return this.logType;
	}

	public void setLogType(String logType) {
		this.logType = logType;
	}

	@Column(name = "LOG_DESC", nullable = false, length = 200)
	public String getLogDesc() {
		return this.logDesc;
	}

	public void setLogDesc(String logDesc) {
		this.logDesc = logDesc;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Log))
			return false;
		Log castOther = (Log) other;

		return ((this.getLogId() == castOther.getLogId()) || (this.getLogId() != null
				&& castOther.getLogId() != null && this.getLogId().equals(
				castOther.getLogId())))
				&& ((this.getOperName() == castOther.getOperName()) || (this
						.getOperName() != null && castOther.getOperName() != null && this
						.getOperName().equals(castOther.getOperName())))
				&& ((this.getCardNo() == castOther.getCardNo()) || (this
						.getCardNo() != null && castOther.getCardNo() != null && this
						.getCardNo().equals(castOther.getCardNo())))
				&& ((this.getLogDate() == castOther.getLogDate()) || (this
						.getLogDate() != null && castOther.getLogDate() != null && this
						.getLogDate().equals(castOther.getLogDate())))
				&& ((this.getLogTime() == castOther.getLogTime()) || (this
						.getLogTime() != null && castOther.getLogTime() != null && this
						.getLogTime().equals(castOther.getLogTime())))
				&& ((this.getLogType() == castOther.getLogType()) || (this
						.getLogType() != null && castOther.getLogType() != null && this
						.getLogType().equals(castOther.getLogType())))
				&& ((this.getLogDesc() == castOther.getLogDesc()) || (this
						.getLogDesc() != null && castOther.getLogDesc() != null && this
						.getLogDesc().equals(castOther.getLogDesc())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getLogId() == null ? 0 : this.getLogId().hashCode());
		result = 37 * result
				+ (getOperName() == null ? 0 : this.getOperName().hashCode());
		result = 37 * result
				+ (getCardNo() == null ? 0 : this.getCardNo().hashCode());
		result = 37 * result
				+ (getLogDate() == null ? 0 : this.getLogDate().hashCode());
		result = 37 * result
				+ (getLogTime() == null ? 0 : this.getLogTime().hashCode());
		result = 37 * result
				+ (getLogType() == null ? 0 : this.getLogType().hashCode());
		result = 37 * result
				+ (getLogDesc() == null ? 0 : this.getLogDesc().hashCode());
		return result;
	}

}